<?php
/**
 * 零起飞-(07FLY-CRM)
 * ==============================================
 * 版权所有 2015-2028   成都零起飞网络，并保留所有权利。
 * 网站地址: http://www.07fly.xyz
 * ----------------------------------------------------------------------------
 * 如果商业用途务必到官方购买正版授权, 以免引起不必要的法律纠纷.
 * ==============================================
 * Author: kfrs <goodkfrs@QQ.com> 574249366
 * Date: 2019-10-3
 */
namespace app\workflow\model;

/**
 *  自定义表单模型
 */
class WorkflowDiyData extends WorkflowBase
{
    /**
     * 审核状态
     * @param $key
     * @return array|array[]|string
     * @author: 开发人生 goodkfrs@qq.com
     * @Time: 2023/1/4 14:54
     */
    public  function audit_status($key = '')
    {
        $data = array(
            "0" => array(
                'id' => '0',
                'name' => '临时单',
                'html' => '<span class="label label-warning">临时单<span>',
                'action' => array(
                    array(
                        'url' => url('del'),
                        'class' => 'ajax-del',
                        'color' => '#F05050',
                        'name' => '删除'
                    ),
                    array(
                        'url' => url('edit'),
                        'class' => 'ajax-open',
                        'color' => '#23B7E5',
                        'name' => '修改'
                    ),
                    array(
                        'url' => url('audit_send'),
                        'class' => 'ajax-open confirm',
                        'color' => '#27c24c',
                        'name' => '送审'
                    ),
                ),
            ),
            "1" => array(
                'id' => '1',
                'name' => '待审核',
                'html' => '<span class="label label-warning">待审核<span>',
                'action' => array(
//                    array(
//                        'url' => url('audit_cancel'),
//                        'class' => 'ajax-open',
//                        'color' => '#27c24c',
//                        'name' => '撤消'
//                    ),
                    array(
                        'url' => url('del'),
                        'class' => 'ajax-del',
                        'color' => '#F05050',
                        'name' => '删除'
                    ),
                    array(
                        'url' => url('edit'),
                        'class' => 'ajax-open',
                        'color' => '#23B7E5',
                        'name' => '修改'
                    ),
                ),
            ),
            "2" => array(
                'id' => '2',
                'name' => '审核中',
                'html' => '<span class="label label-info">审核中<span>',
                'action' => array(
                    array(
                        'url' => url('detail'),
                        'class' => 'ajax-open',
                        'color' => '#23B7E5',
                        'name' => '详细'
                    ),
//                    array(
//                        'url' => url('audit_cancel'),
//                        'class' => 'ajax-get confirm',
//                        'color' => '#F05050',
//                        'name' => '撤消'
//                    ),
                ),
            ),
            "3" => array(
                'id' => '3',
                'name' => '已通过',
                'html' => '<span class="label label-success">已通过<span>',
                'action' => array(
//                    array(
//                        'url' => url('del'),
//                        'class' => 'ajax-del',
//                        'color' => '#F05050',
//                        'name' => '删除'
//                    ),
//                    array(
//                        'url' => url('edit'),
//                        'class' => 'ajax-open',
//                        'color' => '#23B7E5',
//                        'name' => '修改'
//                    ),
                ),
            ),
            "4" => array(
                'id' => '4',
                'name' => '被拒绝',
                'html' => '<span class="label label-danger">被拒绝<span>',
                'action' => array(
                    array(
                        'url' => url('del'),
                        'class' => 'ajax-del',
                        'color' => '#F05050',
                        'name' => '删除'
                    ),
                    array(
                        'url' => url('edit'),
                        'class' => 'ajax-open',
                        'color' => '#23B7E5',
                        'name' => '修改'
                    ),
                    array(
                        'url' => url('audit_send'),
                        'class' => 'ajax-open confirm',
                        'color' => '#27c24c',
                        'name' => '送审'
                    ),
                ),
            ),
            "5" => array(
                'id' => '5',
                'name' => '被撤消',
                'html' => '<span class="label label-default">被撤消<span>',
                'action' => array(
                    array(
                        'url' => url('del'),
                        'class' => 'ajax-del',
                        'color' => '#F05050',
                        'name' => '删除'
                    ),
                    array(
                        'url' => url('edit'),
                        'class' => 'ajax-open',
                        'color' => '#23B7E5',
                        'name' => '修改'
                    ),
                    array(
                        'url' => url('audit_send'),
                        'class' => 'ajax-open confirm',
                        'color' => '#27c24c',
                        'name' => '送审'
                    ),
                ),
            ),
        );
        //返回数据
        if (!empty($key) || is_numeric($key)) {
            if (array_key_exists($key, $data)) {
                return $data[$key];
            } else {
                return '~未知~';
            }
        } else {
            return $data;
        }
    }

}
